home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 458 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.6 KB  |  52 lines

  1. Newsgroups: comp.lang.c
  2. Path: news.kei.com!wang!news
  3. From: emild@cs.technion.ac.il (Kohn Emil Dan)
  4. Subject: Re: HP UX 10.0 C programming 
  5. Organization: Technion, Israel Institute of Technology
  6. Date: Fri, 5 Jan 1996 15:03:16 GMT
  7. Message-ID: <Pine.SV4.3.91-heb-2.04.960105165958.15614A-100000@cs.technion.ac.il>
  8. References: <4cfje3$qk@nn.fast.net> 
  9. Sender: news@wang.com
  10.  
  11. 5
  12.  
  13. On 4 Jan 1996, Chad R. Laity wrote:
  14.  
  15. > 2 questions: (1) What is a good book for HP UX 10.0 C programming?
  16. >            (2) Why do I get an error on this cut down program listed
  17. >                below when I compile it on an HP 9000 K200 with HP UX 10.0
  18. >                and I do not get an error with our Intergraph server?
  19. >                (basically I just want to get the file size of a file but
  20. >                 this buf problem is giving me a head ache)
  21. > ----------------------- program ---------------------------------
  22. > #include <stdio.h>
  23. > #include <sys/stat.h>
  24. > main()
  25. > {
  26. Perhaps this is your problem: You didn't define any variable of type 
  27. 'struct stat'. stat.h contains only the declaration of struct stat, not a 
  28. definition of any variable of this type.
  29.  
  30. Add this line and see if it works:
  31.  
  32. struct stat buf;
  33.  
  34.  
  35. > int i;
  36. > int stat(const char *path, struct stat *buf);    
  37. > i = stat("/usr2/test/testfile", &buf);           /* line 15 */
  38. > }
  39. > ------------------------ error -----------------------------------
  40. > Compiled using: cc -Aa test.c
  41. > cc: "test.c", line 15: error 1588: "buf" undefined.
  42. > cc: "test.c", line 15: warning 563: Argument #2 is not the correct type.
  43.